﻿<phone:PhoneApplicationPage 
    x:Class="VK.Audio"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot представляет корневую сетку, где размещается все содержимое страницы-->
    <Grid x:Name="LayoutRoot" Background="Transparent" >
        <ProgressBar Name="progressBar1" Value="0" IsIndeterminate="True" VerticalAlignment="Top" Margin="0" />
        <!--Элемент управления Pivot-->
        <Image x:Name="Cover" Source="Images\Backgrounds\DARK.background.png" Opacity="0.2" Visibility="Visible" />
        <controls:Pivot Title="VKplay">
            <controls:PivotItem Header="Альбомы">
                <Grid>
                    <ListBox HorizontalAlignment="Left" x:Name="AlbumsList" Width="456" Background="Transparent" SelectionChanged="AlbumsList_SelectionChanged" SelectionMode="Single" FontSize="48"  />
                </Grid>
            </controls:PivotItem>
            <!--Первый элемент Pivot-->
            <controls:PivotItem Header="Аудиозаписи" >
                <Grid>
                    <!--<TextBlock x:Name="txtCurrentTrack" Height="75" HorizontalAlignment="Center" VerticalAlignment="Center" Width="438" TextWrapping="Wrap" />-->
                    <ListBox HorizontalAlignment="Left" x:Name="AudioFilesList" Width="456" FontSize="40" SelectionChanged="AudioFilesList_SelectionChanged" SelectionMode="Single" />
                </Grid>
            </controls:PivotItem>

            <!--Второй элемент Pivot-->
            <controls:PivotItem Header="Играет">
                <Grid>
                    <TextBlock x:Name="emptyDefaultText" Width="95" Height="55" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" FontSize="26.667">Пусто</TextBlock>
                    <StackPanel x:Name="PlayPanel" VerticalAlignment="Bottom" Margin="0,0,0,40">
                    	<TextBlock x:Name="albumText"
                    		FontSize="{StaticResource PhoneFontSizeLarge}"
                    		Margin="0 24 0 0"
                    		TextAlignment="Center"
                    		TextWrapping="Wrap" />

                    	<TextBlock x:Name="artistText"
                    		FontSize="{StaticResource PhoneFontSizeExtraLarge}"
                    		Margin="0 24"
                    		TextAlignment="Center"
                    		TextWrapping="Wrap" />

                    	<TextBlock x:Name="trackText"
                    		FontSize="{StaticResource PhoneFontSizeMedium}"
                    		TextAlignment="Center"
                    		TextWrapping="Wrap" />

                    	<Grid Margin="0,0,0,20">
                    		<Grid.RowDefinitions>
                    			<RowDefinition Height="Auto" />
                    			<RowDefinition Height="Auto" />
                    		</Grid.RowDefinitions>

                    		<Grid.ColumnDefinitions>
                    			<ColumnDefinition Width="*" />
                    			<ColumnDefinition Width="*" />
                    			<ColumnDefinition Width="*" />
                    		</Grid.ColumnDefinitions>

                    		<Slider x:Name="positionSlider"
                    			Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3"
                    			Minimum="0" Maximum="1"
                    			SmallChange="0.1"
                    			LargeChange="0.1"
                    			ValueChanged="OnSliderValueChanged"
                    			Tap="positionSlider_Tap" />

                    		<TextBlock x:Name="elapsedDuration"
                    			Grid.Row="1" Grid.Column="0"
                    			TextAlignment="Left" />

                    		<TextBlock x:Name="playerState"
                    			Grid.Row="1" Grid.Column="1"
                    			TextAlignment="Center" />

                    		<TextBlock x:Name="totalDuration"
                    			Grid.Row="1" Grid.Column="2"
                    			TextAlignment="Right" />
                    	</Grid>
                    	<Grid>
                    		<Image x:Name="repeatImg" Source="Images/Icons/DARK.repeat.png" Width="48" Height="48" HorizontalAlignment="Left" Margin="20,0,0,0" Visibility="Collapsed"  Tap="repeatImg_Tap" />
                    		<Image x:Name="shuffleImg" Source="Images/Icons/DARK.shuffle.png" Width="48" Height="48" HorizontalAlignment="Right" Margin="0,0,20,0" Visibility="Collapsed"  Tap="shuffleImg_Tap" />
                    	</Grid>
                    </StackPanel>
                </Grid>
            </controls:PivotItem>
        </controls:Pivot>
    </Grid>

    <!--Пример кода, иллюстрирующий использование ApplicationBar-->

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar>
            <shell:ApplicationBarIconButton x:Name="prevAppBarButton"
                                            IconUri="Images/Icons/appbar.transport.rew.rest.png"
                                            Text="previous"
                                            IsEnabled="False"
                                            Click="prevButton_Click" />

            <shell:ApplicationBarIconButton x:Name="playAppBarButton"
                                            IconUri="Images\Icons\appbar.transport.play.rest.png"
                                            Text="play"
                                            IsEnabled="False"
                                            Click="playButton_Click" />
            
            <shell:ApplicationBarIconButton x:Name="pauseAppBarButton"
                                            IconUri="Images\Icons\appbar.transport.pause.rest.png"
                                            Text="pause"
                                            IsEnabled="False"
                                            Click="pauseButton_Click" />

            <shell:ApplicationBarIconButton x:Name="nextAppBarButton"
                                            IconUri="Images\Icons\appbar.transport.ff.rest.png"
                                            Text="next"
                                            IsEnabled="False"
                                            Click="nextButton_Click" />
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>    
</phone:PhoneApplicationPage>